import {Http} from "../util/http";

export async function getCarouselImg () {
    return await Http.get({
        url: '/getCarouselImg',
        token: null
    })
}
export async function getTypeList () {
    return await Http.get({
        url: '/article/getTypeList',
        token: null
    })
}

export async function getAllByPage (page, size, typeId) {
    return await Http.post({
        url: `/article/getAllByPage?page=${page}&size=${size}&typeId=${typeId}`,
        token: null
    })
}
export async function getSocketRoom () {
    return await Http.get({
        url: '/getSocketRoom',
        token: null
    })
}
export async function sendOneWebSocket ({receiverName, message}) {
    return await Http.get({
        url: '/sendOneWebSocket',
        receiverName,
        message,
    })
}
export async function sendAllWebSocket (data) {
    return await Http.post({
        url: '/sendAllWebSocket',
        data
    })
}

    export async function getChatRoomRecord (roomId) {
    return await Http.get({
        url: `/getChatRoomRecord?roomId=${roomId}`,
    })
}
